# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=raptor2
pkgver=2.0.15
pkgrel=4
pkgdesc="RDF parser toolkit for Redland"
url="https://librdf.org/raptor"
arch="all"
license="LGPL-2.1-or-later"
options="!check" # Checking ex-07.rdf FAILED
depends_dev="curl-dev libxml2-dev libxslt-dev yajl-dev"
makedepends="$depends_dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://download.librdf.org/source/raptor2-$pkgver.tar.gz
	CVE-2017-18926.patch
	CVE-2020-25713.patch
	"

# secfixes:
#   2.0.15-r3:
#     - CVE-2020-25713
#   2.0.15-r2:
#     - CVE-2017-18926

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target=$CTARGET \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}
sha512sums="
563dd01869eb4df8524ec12e2c0a541653874dcd834bd1eb265bc2943bb616968f624121d4688579cdce11b4f00a8ab53b7099f1a0850e256bb0a2c16ba048ee  raptor2-2.0.15.tar.gz
203ae75dae8242fb7988a199df8a7337b0660871f5caa6c9098167536ba880ad55765bb60fd4315020f208ed3ae8dc03eb1b91241851410a961a797192ecb969  CVE-2017-18926.patch
7fa756a8a74f2f0814e1cd536fb25ea07dac49be6ee8e44213e2c2948c923f7478e84d769a0d9c1eb52bb81a9a256d92833b13da0ccac8635a0eeefd7b7df12a  CVE-2020-25713.patch
"
